﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Text;
namespace Chizx.Web.summary
{
    public partial class Show : Page
    {        
        		public string strid=""; 
		protected void Page_Load(object sender, EventArgs e)
                {
                    if (null == Session["UserEntity"])
                    {
                        Response.Redirect("/e/Login.aspx");
                    }
			if (!Page.IsPostBack)
			{
				int zsm_id = -1;
				if (Request.Params["id0"] != null && Request.Params["id0"].Trim() != "")
				{
					zsm_id=(Convert.ToInt32(Request.Params["id0"]));
				}
				string zu_id = "";
				if (Request.Params["id1"] != null && Request.Params["id1"].Trim() != "")
				{
					zu_id= Request.Params["id1"];
				}
				ShowInfo(zsm_id,zu_id);
			}
		}
		
	private void ShowInfo(int zsm_id,string zu_id)
	{
		Chizx.BLL.SummaryBll bll=new Chizx.BLL.SummaryBll();
		Chizx.Model.SummaryModel model=bll.GetModel(zsm_id,zu_id);
		this.lblzsm_id.Text=model.zsm_id.ToString();
		this.lblzu_id.Text=model.zu_id;
        this.lblzsm_type.Text = model.zsm_type == "s0" ? "自主实习" : (model.zsm_type == "s1" ? "分配实习" : "未知");
		this.lblzsm_cid.Text=model.zsm_cid == 0?"无":model.zsm_cid.ToString();
		this.lblzsm_cname.Text=model.zsm_cname;
		this.lblzsm_caddress.Text=model.zsm_caddress;
		this.lblzsm_applydesc.Text=model.zsm_applydesc;
		this.lblzsm_journalnum.Text=model.zsm_journalnum.ToString();
		this.lblzsm_context.Text=model.zsm_context;
        this.lblzsm_attachpath.Text = "<a href='"+model.zsm_attachpath+"' target='_blank'>下载附件</a>";
        
		
		this.lblzsm_check.Text=model.zsm_check;
		this.lblzsm_createdate.Text=model.zsm_createdate.ToString();
		this.lblzsm_status.Text=model.zsm_status;
        this.lblzsm_status.Text = model.zsm_status == "s0" ? "未审核" : (model.zsm_status == "s1" ? "审核通过,已结束" : (model.zsm_status == "s2" ? "审核未通过,已驳回" : "未知状态"));
        //写入系统日志
        if (Session["UserEntity"] == null)
        {
            Response.Redirect("/e/Login.aspx");
        }
        else
        {
            Chizx.Model.UserModel sbmmodel = (Chizx.Model.UserModel)Session["UserEntity"];
            Chizx.BLL.SystemLogBll sbll = new Chizx.BLL.SystemLogBll();
            Chizx.Model.SystemLogModel slm = new Chizx.Model.SystemLogModel();
            slm.zu_id = sbmmodel.zu_id;
            slm.zl_dowhen = DateTime.Now;
            slm.zl_dowhat = "查看实习总结";
            slm.zl_dotype = "2";//0:Test,1:Auth,2:Read,3:Write,4:Del,5:Inpor
            slm.zl_dodesc = "操作成功";
            sbll.Add(slm);
        }

    }


    }
}
